﻿@model SRF.Admin.Models.Permission
@{
    Layout = "~/Views/Shared/_EditDialog.cshtml";  
}
@using SRF.UI.Html
@section header{
    <script type="text/javascript" language="javascript">
        var parentType = "@ViewBag.ParentType";
        $(function () {
            document.title = $("#Id").val() == "" ? "新增功能项" : "修改功能项";
            if (parentType == "")
                $("#Type>option[value='Action']").remove();
        })
        function onComplete() {
            $.dialog.close("ok");
        }
        function onDialogClose(msg) {
            $.ajaxSubmit();
        } 
    </script>
}
@using (Ajax.BeginForm("Edit", null, new AjaxOptions() { HttpMethod = "Post", OnComplete = "onComplete" }, new { @class = "form-horizontal" }))
{   
    @Html.HiddenFor(m => m.Id)
    @Html.HiddenFor(m => m.ParentId)
    <table>
        <tr>
            <td colspan="2">
                <label class="control-label" for="Name">
                    名称:</label>
                @Html.TextBoxFor(m => m.Name)
            </td>
        </tr>
        <tr>
            <td>
                <label class="control-label" for="Code">
                    编码:</label>
                @Html.TextBoxFor(m => m.Code)
            </td>
            <td>
                <label class="control-label" for="Type">
                    类型:</label>
                @Html.EnumDropDownListFor(m => m.Type)
            </td>
        </tr>
        <tr>
            <td colspan="2">
                <label class="control-label" for="Url">
                    地址:</label>
                @Html.TextBoxFor(m => m.Url, new { @class = "textbox-larger" })
            </td>
        </tr>
        <tr>
            <td colspan="2">
                <label class="control-label" for="Remark">
                    说明:</label>
                @Html.TextBoxFor(m => m.Remark, new { @class = "textbox-larger" })
            </td>
        </tr>
    </table>
}